﻿@{
    Layout = null;
    var tree_org_formatter = PageViewModel.PageFunctionName(this, "tree_org_formatter");
    var on_before_select_fun = PageViewModel.PageFunctionName(this, "on_before_select_fun");
}

<form>
    <script type="text/javascript">
        function @tree_org_formatter (node) {
            if (node.NodeType == 'ORG') {
                return "<div style='color:#cdcdcd'>" + node.text + "</div>";
            }
            return node.text;
        }

        function @on_before_select_fun (node) {
            if (node.NodeType == 'ORG') {
                $(this).tree('unselect');
            }
        }
    </script>
    <table class="form_table">
        <tr>
            <td width="160" align="right">所属部门：</td>
            <td colspan="3">
                <input name="Id" style="display:none" value="" />
                <input id="DepartmentID" name="DepartmentID" class="easyui-combotree" style="width:300px"
                       data-options="url:'~/Departments/GetDepartmentFullTree',method:'get',editable:false,valueField:'Id',textField:'FullName',required:true,
                                     formatter:@tree_org_formatter,
                                     onBeforeSelect:@on_before_select_fun" />
            </td>
        </tr>
        <tr>
            <td align="right">岗位编号：</td>
            <td colspan="3">
                <input name="Code" class="easyui-textbox" style="width:300px;" />
            </td>
        </tr>
        <tr>
            <td align="right">岗位名称：</td>
            <td colspan="3">
                <input name="Name" class="easyui-textbox" style="width:300px;" data-options="required:true" />
            </td>
        </tr>
        <tr>
            <td align="right">岗位职责：</td>
            <td colspan="3">
                <input name="Comment" class="easyui-textbox" style="width:300px;height:60px" maxlength="512" data-options="multiline:true" />
            </td>
        </tr>
        <tr>
            <td align="right">岗位说明：</td>
            <td colspan="3">
                <input name="Description" class="easyui-textbox" style="width:300px;height:60px" maxlength="512" data-options="multiline:true" />
            </td>
        </tr>
        <tr>
            <td align="right">状态：</td>
            <td width="100">
                <input id="Enable" name="Enable" class="easyui-switchbutton" checked data-options="onText:'启用',offText:'停用'" style="width:90px;height:23px;" />
            </td>
            <td></td>
            <td>
                <input class="easyui-checkbox" id="Critical" name="Critical" label="关键岗位：">
            </td>
        </tr>

    </table>
</form>
